/* 
 * Copyright [2018] [Alex/libo(liboms@hotmail.com)]
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.apidoc.javadoc;

import java.util.List;

import com.hyts.apidoc.base.BaseApiParser;
import com.hyts.apidoc.config.ParseDocType;
import com.hyts.apidoc.model.ApiDoc;
import com.hyts.apidoc.utility.ParserFactory;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.RootDoc;

/** 
 * @title JavaDocHandler.java  
 * @package com.hyts.apidoc.javadoc  
 * @description JavaDocHandler 基础解析类：
 * 				用于解析javadoc级别的系统解析文档信息
 * 				得出最后的结果字段。  
 * @see TODO
 * @author libo/Alex
 * @email liboms@hotmail.com/liboware@163.com  
 * @date 2018年4月23日 
 * @version V1.0 
 */
public final class JavaDocHandler {

	/**  
	 * <b>start：默认启动方法</b>
	 * <p>解析和读取注释的核心方法</p>
	 * @param root 回掉函数返回的参数
	 * @return 是否成功解析
	 * @exception
	 */ 
	public static boolean start(RootDoc root) {
	    ClassDoc[] classDocs = root.classes();
	    //设置为JAVADOC方法解析操作
	    ParserFactory.setDocType(ParseDocType.JAVADOC);
	    BaseApiParser<ClassDoc[],ApiDoc> parser = ParserFactory.getInstance();
	    List<ApiDoc> docLists = parser.generateDoc(classDocs);
		return true;
	}	
	
}
